using System.Collections;
using System.Collections.Generic;
using Unity.Entities;
using Unity.Mathematics;
using UnityEngine;
using Random = UnityEngine.Random;

public struct Movement:IComponentData
{
    public float3 MovementVector;
}

public class MovementAuthoring : MonoBehaviour
{
    private class Baker:Baker<MovementAuthoring>
    {
        public override void Bake(MovementAuthoring authoring)
        {
            Entity entity = GetEntity(TransformUsageFlags.Dynamic);
            AddComponent(entity,new Movement()
            {
                MovementVector = new float3(Random.Range(-1,1),0,Random.Range(-1,1))
            });
        }
    }
}
